package org.kkk.sandbox.controller;

import org.kkk.sandbox.model.ExecuteCodeRequest;
import org.kkk.sandbox.model.ExecuteCodeResponse;
import org.kkk.sandbox.sandbox.impl.JavaDockerCodeSandbox;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("exec")
public class ExecController {
    @PostMapping("java")
    public ExecuteCodeResponse judgeQuestion(@RequestBody ExecuteCodeRequest executeCodeRequest)
    {
        return new JavaDockerCodeSandbox().executeCode(executeCodeRequest);
    }
}
